/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.own.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

import java.util.Date;

/**
 * 药材分包信息Entity
 * @author F
 * @version 2019-10-09
 */
@Table(name="own_medicine_subcontracting", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一ID", isPK=true),
		@Column(name="own_medicine_receipt_information_id", attrName="ownMedicineReceiptInformationId", label="药材收获信息ID", isQuery=false),
		@Column(name="medicine_batch_id", attrName="medicineBatchId", label="药材批次号"),
		@Column(name="source_code", attrName="sourceCode", label="商品编码"),
		@Column(name="variety_name", attrName="varietyName", label="品名", queryType=QueryType.LIKE),
		@Column(name="area_code", attrName="areaCode", label="区域编码"),
		@Column(name="spec", attrName="spec", label="规格"),
		@Column(name="this_subcontracting_weight", attrName="thisSubcontractingWeight", label="此次分包重量", comment="此次分包重量(g)"),
		@Column(name="this_subcontracting_num", attrName="thisSubcontractingNum", label="此次分包包数"),
		@Column(name="weight", attrName="weight", label="单包重量", comment="单包重量(g)"),
		@Column(name="bm_batch_code", attrName="bmBatchCode", label="药材批次码"),
		@Column(name="time", attrName="time", label="分包时间"),
		@Column(name="create_company", attrName="createCompany", label="所属企业标识", isUpdate=false, isQuery=false),
		@Column(name="uuid", attrName ="uuid",label = "操作标识符"),
		@Column(name="txid", attrName ="txid",label = "返回的txid"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class OwnMedicineSubcontracting extends DataEntity<OwnMedicineSubcontracting> {
	
	private static final long serialVersionUID = 1L;
	private String ownMedicineReceiptInformationId;		// 药材收获信息ID
	private String medicineBatchId;		// 药材批次号
	private String sourceCode;		// 商品编码
	private String varietyName;		// 品名
	private String areaCode;		// 区域编码
	private String spec;		// 规格
	private Double thisSubcontractingWeight;		// 此次分包重量(g)
	private Long thisSubcontractingNum;		// 此次分包包数
	private Double weight;		// 单包重量(g)
	private String bmBatchCode;		// 药材批次码
	private Date time;		// 分包时间
	private String createCompany;		// 所属企业标识
	private String uuid;		//索引本次操作的上下文标识
	private String txid;


	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getTxid() {
		return txid;
	}

	public void setTxid(String txid) {
		this.txid = txid;
	}

	public OwnMedicineSubcontracting() {
		this(null);
	}

	public OwnMedicineSubcontracting(String id){
		super(id);
	}

	@NotBlank(message="药材收获信息ID不能为空")
	@Length(min=0, max=64, message="药材收获信息ID长度不能超过 64 个字符")
	public String getOwnMedicineReceiptInformationId() {
		return ownMedicineReceiptInformationId;
	}

	public void setOwnMedicineReceiptInformationId(String ownMedicineReceiptInformationId) {
		this.ownMedicineReceiptInformationId = ownMedicineReceiptInformationId;
	}
	
	@NotBlank(message="药材批次号不能为空")
	@Length(min=0, max=25, message="药材批次号长度不能超过 25 个字符")
	public String getMedicineBatchId() {
		return medicineBatchId;
	}

	public void setMedicineBatchId(String medicineBatchId) {
		this.medicineBatchId = medicineBatchId;
	}

	@NotBlank(message="商品编码不能为空")
	@Length(min=0, max=50, message="商品编码长度不能超过 50 个字符")
	public String getSourceCode() {
		return sourceCode;
	}

	public void setSourceCode(String sourceCode) {
		this.sourceCode = sourceCode;
	}

	@NotBlank(message="品名不能为空")
	@Length(min=0, max=50, message="品名长度不能超过 50 个字符")
	public String getVarietyName() {
		return varietyName;
	}

	public void setVarietyName(String varietyName) {
		this.varietyName = varietyName;
	}

	@NotBlank(message="区域编码不能为空")
	@Length(min=0, max=6, message="区域编码长度不能超过 6 个字符")
	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	@NotBlank(message="规格不能为空")
	@Length(min=0, max=10, message="规格长度不能超过 10 个字符")
	public String getSpec() {
		return spec;
	}

	public void setSpec(String spec) {
		this.spec = spec;
	}

	@NotNull(message="此次分包重量不能为空")
	public Double getThisSubcontractingWeight() {
		return thisSubcontractingWeight;
	}

	public void setThisSubcontractingWeight(Double thisSubcontractingWeight) {
		this.thisSubcontractingWeight = thisSubcontractingWeight;
	}

	@NotNull(message="此次分包包数不能为空")
	public Long getThisSubcontractingNum() {
		return thisSubcontractingNum;
	}

	public void setThisSubcontractingNum(Long thisSubcontractingNum) {
		this.thisSubcontractingNum = thisSubcontractingNum;
	}

	@NotNull(message="单包重量不能为空")
	public Double getWeight() {
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}

	@NotBlank(message="药材批次码不能为空")
	@Length(min=0, max=50, message="药材批次码长度不能超过 50 个字符")
	public String getBmBatchCode() {
		return bmBatchCode;
	}

	public void setBmBatchCode(String bmBatchCode) {
		this.bmBatchCode = bmBatchCode;
	}

	@NotNull(message="分包时间不能为空")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}
	
	@Length(min=0, max=64, message="所属企业标识长度不能超过 64 个字符")
	public String getCreateCompany() {
		return createCompany;
	}

	public void setCreateCompany(String createCompany) {
		this.createCompany = createCompany;
	}
	
}